package com.demo.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

//@Configuration
public class DataSourceConfig {

    @Bean
    @Demo
    @Conditional({ConditionDemo.class})     //该类限定@Bean的有效性
    public DataSource dataSource(){
        return new DataSource();
    }
}
